home *** CD-ROM | disk | FTP | other *** search
/ How Many Bugs in a Box / How Many Bugs in a Box.cdr / bugs / act4 / 00077.ls < prev    next >
Encoding:
Text File  |  1995-04-05  |  1.8 KB  |  55 lines

  1. on exitFrame
  2.   global level1, buglist, SubBug, CurrentBug, pal, NumofCol, BugColorKey, BugColors, gamefourlevel, cursorset, introplayed, canclicked, bigintrosound, mysound
  3.   resetgame()
  4.   set canclicked to [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  5.   if count(buglist) = 0 then
  6.     set buglist to [1, 2, 3, 4, 5, 6, 7, 8, 9]
  7.   end if
  8.   set randombug to random(count(buglist))
  9.   set CurrentBug to getAt(buglist, randombug)
  10.   deleteAt(buglist, randombug)
  11.   set SubBug to random(3)
  12.   if gamefourlevel = 1 then
  13.     set NumofCol to 4
  14.   else
  15.     set NumofCol to 10
  16.   end if
  17.   set infoOffset to ((CurrentBug - 1) * 9) + ((level1 - 1) * 3) + SubBug
  18.   set stemp to line infoOffset of the text of cast "buginfo"
  19.   set BugColorKey to []
  20.   set BugColors to []
  21.   set howmany to the number of items in stemp
  22.   repeat with xxx = 1 to howmany
  23.     add(BugColorKey, value(item xxx of stemp))
  24.     add(BugColors, 0)
  25.   end repeat
  26.   set pal to []
  27.   set crunch to [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
  28.   if level1 = 1 then
  29.     set crunch to [1, 9, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 10, 1, 2, 3, 4, 5, 6, 7]
  30.   end if
  31.   repeat with xxx = 1 to NumofCol
  32.     set sample to random(count(crunch))
  33.     if (level1 = 1) and (getAt(crunch, sample) > 7) then
  34.       set sample to random(count(crunch))
  35.     end if
  36.     repeat while not (getPos(pal, getAt(crunch, sample)) = 0)
  37.       set sample to random(count(crunch))
  38.     end repeat
  39.     add(pal, getAt(crunch, sample))
  40.     deleteAt(crunch, sample)
  41.   end repeat
  42.   puppetSprite(48, 0)
  43.   if level1 = 1 then
  44.     go("Level" & level1 & ".0")
  45.   else
  46.     if bigintrosound = [] then
  47.       set bigintrosound to [1, 2, 3]
  48.     end if
  49.     set intros to getAt(bigintrosound, random(count(bigintrosound)))
  50.     deleteAt(bigintrosound, getPos(bigintrosound, intros))
  51.     set mysound to "large box " & intros
  52.     go("Level" & level1 & ".0")
  53.   end if
  54. end
  55.